#!/usr/bin/env python
"""Provides ...

funktioniert dann noch Unit-Testing
kann ich die Daten schnell mit Python herauslesen!!

-->
InputPackage = "Blahh macht das und das und blubbt herum."
column1 = {'type': "System.Int32", 'description': "Input Blahh macht was", 'defaultValue': 12}
column2 = {'type': "System.Int32", 'description': "Blahh macht was default", 'validation': "IsInt"}
-->

<--
OutputData = "Irgendwas anderes blahh blubb und es macht so viel Spass"
outputcolumn = {'type': "System.Int32", 'description': "Output Blahh macht was"}
<--
"""

from MyClever.Lib import MissionPlugin

__author__ = "Mathias Mielitz"
__copyright__ = "Copyright 2012, MyCleverFriend"
__credits__ = ["Mathias Mielitz"]
__license__ = "GPL"
__version__ = "1.0.0"
__maintainer__ = "Mathias Mielitz"
__email__ = "m.mielitz@adrabbit.de"
__status__ = "Production"
__description__ = "Ein super tolles Testplugin geschrieben in Python."

class PackageTest(MissionPlugin):
	def Work(self):
		"""All very experimental..."""
		
		inputPackage = self.GetDataReader("InputPackage")
		while inputPackage.Read():
			self.AddNewLoggingMessage("InputPackage", "berechne: " + inputPackage["column1"].ToString() + " + " + inputPackage["column2"].ToString())
			
			newRow = self.CreateNewRowFromPackage("OutputData")
			newRow["outputcolumn"] = inputPackage["column1"] + inputPackage["column2"]
			self.AddNewRowToPackage("OutputData", newRow)